package date;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author LIBOFEI
 * @ClassName Test2
 * @description
 * @date 2021/11/19 18:41
 * @Version 1.0
 **/
public class Test2 {

    public static SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");

    public static Calendar c = Calendar.getInstance();



    public static void main(String[] args) {
//        getDay(7);
//        getDay(30);
//        getDay(90);

    }


    public static void getDay(int number){
        Date date = new Date();
        c.setTime(date);
        System.out.println(sf.format(c.getTime()));
        for(int i = number - 1; i > 0 ; i --){
            c.add(Calendar.DAY_OF_MONTH,-1);
            System.out.println(sf.format(c.getTime()));
        }
    }
}
